<template>
  <el-row>
    <el-col :span="4" class="logo-wrapper">
      <img :src="logo" class="logo" @click="handler">
    </el-col>
    <el-col :span="20">
      <el-menu mode="horizontal">
        <el-menu-item index="horizontal-1">
          <router-link :to="{ name: 'courseList' }">课程</router-link>
        </el-menu-item>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script>
export default {
    name: 'Header',
    data(){
      return {
        logo: require( '@/assets/kaifamiao.jpg' )
      }
    },
    methods: {
      handler(){
        // 编程式导航
        this.$router.push( { name: 'root' } );
      }
    }
}
</script>

<style scoped>
.logo-wrapper {
  border-bottom: 1px solid #dedede!important ;
}
.logo {
  height: 50px;
}

.logo:hover {
  cursor: pointer ;
}
</style>